<!DOCTYPE html>
<html lang="en">

<head>

    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="description" content="">
    <meta name="author" content="">

    <title>3 Col Portfolio - Start Bootstrap Template</title>

    <!-- Bootstrap Core CSS -->
    <link href="/zswebshop/include/css/bootstrap.min.css" rel="stylesheet">

    <!-- Custom CSS -->
    <link href="/zswebshop/include/css/commodity.css" rel="stylesheet">

    <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
    <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
    <!--[if lt IE 9]>
        <script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
        <script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->

    <!-- 検索 start-->
    <!-- <script type="text/javascript" src="<?php echo JS_DIR?>/common.js"></script> -->
	<script type="text/javascript" src="<?php echo JS_DIR?>/jquery-1.11.2.js"></script>
	<!-- <script type="text/javascript" src="<?php echo JS_DIR?>/jquery-ui-1.7.2.custom.min.js"></script>
	<script type="text/javascript" src="<?php echo JS_DIR?>/jquery.framedialog.js"></script>
	<script type="text/javascript" src="<?php echo JS_DIR?>/jquery.jScale.js"></script>
	<script type="text/javascript" src="<?php echo JS_DIR?>/jquery.post.js"></script> -->
     <script>
		$(document).ready(function(){
			$("#mainsearch_btn").click(function(){
				if($("#mainq").val() == ''){
					alert('검색어를 입력하세요');
					return false;
				} else {

					//var act = '/search/index/q/'+$("#mainq").val();
					//	alert(act);
					//$("#main_search").attr('action', act).submit();

					//var act = '/zswebshop/index.php/search/index/q/'+$("#mainq").val();
					var act = '/zswebshop/index.php/commodity/lists/q/'+$("#mainq").val();
					document.formTest.action = act;
					document.formTest.submit();
				}
			});
		});

		function top_search_enter(form) {
		    var keycode = window.event.keyCode;
		    if(keycode == 13) $("#mainsearch_btn").click();
		}

		 var controller = 'commodity_ajax';
         var base_url = '<?php echo site_url();?>';

		function load_page_ajax(param){
//alert(param);
            $.ajax({

                'url' : base_url + '/' + controller + '/get_commodity',

                'type' : 'POST', //the way you want to send data to your URL

                'data' : {'page' : param},

                'success' : function(data){ //probably this request will return anything, it'll be put in var "data"

                    var container = $('#container'); //jquery selector (get element by id)

                    if(data){

                        container.html(data);

                    }

                }

            });

        }

	</script>
	<!-- 検索 end-->
</head>

<body onLoad="load_page_ajax(1)">



<div id="container"></div>



      <!-- Footer -->
        <footer>
            <div class="row">
                <div class="col-lg-12">
                    <p>Copyright &copy; Your Website 2014</p>
                </div>
            </div>
            <!-- /.row -->
        </footer>

    </div>
    <!-- /.container -->

    <!-- jQuery -->
    <script src="/zswebshop/include/js/jquery-1.11.2.js"></script>

    <!-- Bootstrap Core JavaScript -->
    <script src="/zswebshop/include/js/bootstrap.min.js"></script>

    <script src="/zswebshop/include/js/zs_front.js"></script>


</body>

</html>